package com.sz.mes.dto;

import com.diboot.core.binding.query.BindQuery;
import com.diboot.core.binding.query.Comparison;
import com.sz.mes.entity.WorkHours;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
import java.util.Date;
import com.diboot.core.util.D;

/**
 * 工时 DTO定义
 * @author hem
 * @version 1.0
 * @date 2024-10-22
 * Copyright © szhs
 */
@Getter
@Setter
@Accessors(chain = true)
public class WorkHoursDTO extends WorkHours {

    private static final long serialVersionUID = -2416242360041617756L;

    /**
     * 工作时间-起始
     */
    @BindQuery(comparison = Comparison.GE, field = "workDay")
    private Date workDay;

    /**
     * 工作时间-截止
     */
    @BindQuery(comparison = Comparison.LT, field = "workDay")
    private Date workDayEnd;

    @Override()
    public Date getWorkDay() {
        return this.workDay;
    }

    @Override()
    public WorkHours setWorkDay(Date workDay) {
        this.workDay = workDay;
        return this;
    }

    public Date getWorkDayEnd() {
        return D.nextDay(workDay);
    }

    public WorkHours setWorkDayEnd(Date workDayEnd) {
        this.workDayEnd = workDayEnd;
        return this;
    }
}
